#include "externaltools.h"

Tesseract::Tesseract(QObject *parent) :
	QObject(parent)
{
}
//----------------------------------------------
void Tesseract::run (QString sourceFileName)
{
	QString args;

	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
	QFileInfo fi (sourceFileName);

	QString resultFileName (Config::appWorkPath () + fi.baseName ());

	QString params ("-l fra");

	QProcess::execute (QString ("tesseract %1 %2 %3").arg (sourceFileName).arg (resultFileName).arg (params));

	QApplication::restoreOverrideCursor();

	emit endOfOCR (resultFileName + ".txt");
}
